package cn.strive.eams.busRequire.controller;

import cn.strive.eams.base.response.JsonResult;
import cn.strive.eams.busRequire.pojo.dto.BusRequirePass;
import cn.strive.eams.busRequire.pojo.dto.BusRequireSaveParam;
import cn.strive.eams.busRequire.service.BRService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/busrequire")
@Api(tags = "校车申请业务需求管理")
@Slf4j
public class BRController {

    @Autowired
    BRService brService;

    @PostMapping("/save")
    @ApiOperation(value = "保存校车申请业务需求")
    public JsonResult save(BusRequireSaveParam busRequireSaveParam) {
        log.info("保存校车申请业务需求:busRequireSaveParam={}", busRequireSaveParam);
        brService.save(busRequireSaveParam);
        return JsonResult.ok();
    }

    @PostMapping("/driver")
    @ApiOperation(value = "插入司机信息")
    public JsonResult insertDriver(BusRequirePass busRequirePass) {
        log.info("插入信息:BusRequirePass={}", busRequirePass);
        brService.insertDriver(busRequirePass);
        return JsonResult.ok();
    }
}
